<?php
/*
 * Created on 22.5.2006
 */
 
class pStandard_Password extends cFormElement 
{
	
	function setElement(SimpleXMLElement $elm, $value, cView $view)
	{
		if ($value!='' || $view->action=='insert') {
			parent::setElement($elm, $value, $view);
		}
	}
	
	function getEditText($fieldName, $id, $value, cView $view)
	{
		$size = $this->getAttr("size");
		if (!is_numeric($size) || $size==0) $size = 20;
		$class = $this->getAttr("special")." ".$this->getAttr("field")." ".$this->getAttr("class");
		$s="<fieldset class=\"input\" \">
				<legend>
					<label for=\"".$id."\" />".$this->getAttr("label")."</label>
				</legend>
				<input type=\"password\" size=\"$size\" id=\"$id\" class=\"".$class."\" value=\"\" name=\"".$fieldName."\" />
			</fieldset>";
		return $s;
	}
	
	function getShowText($fieldName, $id, $value, cView $view)
	{
		if ($view->doctype==="raw") return md5($value);
		else return '';
	}
	
	
}
 
?>